<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>案例6</title>
    <link rel="stylesheet" href="../css/index.css">
    <style>
        ul {
            width: 700px;
            flex-wrap: wrap;
        }
        
        li {
            opacity: 0.5;
        }
    </style>
</head>

<body>
    <div class="content">
        <ul class="flex a-c">
            <li><img src="./img/1.jpg" alt=""></li>
            <li><img src="./img/2.jpg" alt=""></li>
            <li><img src="./img/3.jpg" alt=""></li>
            <li><img src="./img/4.jpg" alt=""></li>
            <li><img src="./img/5.jpg" alt=""></li>
            <li><img src="./img/6.jpg" alt=""></li>
            <li><img src="./img/7.jpg" alt=""></li>
            <li><img src="./img/8.jpg" alt=""></li>
            <li><img src="./img/9.jpg" alt=""></li>
            <li><img src="./img/10.jpg" alt=""></li>
        </ul>
    </div>
    <script>
        let imgs = document.querySelectorAll('li')
        for (let index = 0; index < imgs.length; index++) {
            imgs[index].onmousemove = function() {
                this.style.opacity = 1
            }
            imgs[index].onmouseout = function() {
                this.style.opacity = 0.5
            }
        }
    </script>

</body>

</html>